<template>
  <ms-dialog
    title="校验配置（配置后关闭即可）"
    :dialog-visible="validDialog"
    :tools="false"
    @close="$emit('close')"
  >
    <el-form ref="formValid" label-width="80px" :model="validData">
      <el-form-item label="空值校验">
        <el-checkbox v-model="validData.notBlank" />
      </el-form-item>
      <el-row>
        <el-col :span="12">
          <el-form-item label="最短校验">
            <el-input v-model.number="validData.minLength" />
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="最长校验">
            <el-input v-model.number="validData.maxLength" />
          </el-form-item>
        </el-col>
      </el-row>
      <el-form-item label="正则规则">
        <el-input v-model="validData.regexpRule" />
      </el-form-item>
    </el-form>
  </ms-dialog>
</template>

<script>
import MsDialog from '@/common/dialog'

export default {
  components: {
    MsDialog
  },
  props: ['validDialog', 'validData']
}
</script>
